import urllib
import time
#130921196806xxxxx1
f=open('res.txt','a')
for i in range(3,31):
    for j in range(1,1000):
        url = "http://www.youdao.com/smartresult-xml/search.s?type=id&q=130921196806%02d%03d1"%(i,j)
        res = urllib.urlopen(url)
        text=res.read()
        print text
        if "birthday" in text:
            f.write(text)
        time.sleep(1)
